#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int main()
{
    int n;
    unordered_map<int,int> prims;
    cin >> n;
    while(n--)
    {
        int x;
        cin >> x;
        for(int i = 2;i <= x / i;i ++)
        {
            while(x % i == 0)
            {
                x = x / i;
                prims[i] ++;
            }
        }
        if(x > 1) prims[x] ++;
    }
    ll res = 1;
    for (auto p : prims)
    {
        ll a = p.first, b = p.second;
        ll t = 1;
        while (b -- ) t = (t * a + 1) % mod;
        res = res * t % mod;
    }

    cout << res << endl;

    return 0;
}

